﻿using LPP.Entity.Notification;
using LPP.Repository.NotificationRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LPP.Service.NotificationService
{
    public class NotificationService : INotificationService
    {
        private readonly INotificationRepository _notificationRepository;

        public NotificationService(INotificationRepository notificationRepository)
        {
            _notificationRepository = notificationRepository;
        }

        public async Task<bool> CreateNotificationAsync(Notification notification)
        {
            return await _notificationRepository.AddNotificationAsync(notification);
        }

        public async Task<Notification> GetNotificationByIdAsync(int id)
        {
            return await _notificationRepository.GetNotificationByIdAsync(id);
        }

        public async Task<List<Notification>> GetAllNotificationsAsync()
        {
            return await _notificationRepository.GetAllNotificationsAsync();
        }

        public async Task<bool> UpdateNotificationAsync(Notification notification)
        {
            return await _notificationRepository.UpdateNotificationAsync(notification);
        }

        public async Task<bool> DeleteNotificationAsync(int id)
        {
            return await _notificationRepository.DeleteNotificationAsync(id);
        }
    }
}
